package com.lam.framework.bean.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.components.easyexcel.converter.DictConverter;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.validate.annotation.DictValid;
import com.lam.common.validate.group.Add;

/**
 * Table字典配置对象 sys_table_dict
 * 
 * @author admin
 * @date 2022-08-02
 */
@DictCheck
@ColumnWidth(30)
@TableName("sys_table_dict")
public class SysTableDict implements BaseEntity{

    /** 主键 */
    @ExcelProperty("序号")
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 字典编码 */
    @ExcelProperty("字典编码")
    @NotBlank(message = "字典编码不能为空")
    @Size(max = 100, message = "字典编码长度不能超过100个字符")
    private String dictCode;

    /** 表名 */
    @ExcelProperty("表名")
    @NotBlank(message = "表名不能为空")
    @Size(max = 100, message = "表名长度不能超过100个字符")
    private String tableName;

    /** 作为字典value的表字段 */
    @ExcelProperty("value字段")
    @NotBlank(message = "value字段不能为空")
    @Size(max = 100, message = "value字段长度不能超过100个字符")
    private String valueField;

    /** 作为字典text的表字段 */
    @ExcelProperty("text字段")
    @NotBlank(message = "text字段不能为空")
    @Size(max = 200, message = "text字段长度不能超过200个字符")
    private String textField;
    
    /** 查询条件 */
    @ExcelProperty("查询条件")
    @Size(max = 255, message = "查询条件长度不能超过255个字符")
    private String conditionSql;

    /** 状态（1可用 0不可用） */
    @ExcelProperty(value = "状态", converter = DictConverter.class)
    @NotNull(message = "状态不能为空")
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "status_type")
    private Integer status;
    
    /** 类型(1-系统配置，2-业务配置) */
    @ExcelProperty(value = "类型", converter = DictConverter.class)
    @NotNull(message = "类型不能为空")
    @DictValid(message = "无效的类型")
    @Dict(dictCode = "config_type")
    private Integer type;

    /** 排序 */
    @ExcelProperty("排序")
    private Integer sort;

    /** 创建人 */
    @ExcelProperty("创建人")
    private String createBy;

    /** 创建时间 */
    @ExcelProperty("创建时间")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 修改人 */
    @ExcelProperty("修改人")
    private String updateBy;

    /** 修改时间 */
    @ExcelProperty("修改时间")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 备注 */
    @ExcelProperty("备注")
    @Size(max = 200, message = "备注长度不能超过200个字符")
    private String remark;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setDictCode(String dictCode) {
        this.dictCode = dictCode;
    }

    public String getDictCode() {
        return dictCode;
    }    
    
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getTableName() {
        return tableName;
    }    
    
    public void setValueField(String valueField) {
        this.valueField = valueField;
    }

    public String getValueField() {
        return valueField;
    }    
    
    public void setTextField(String textField) {
        this.textField = textField;
    }

    public String getTextField() {
        return textField;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getSort() {
        return sort;
    }    
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }

	public String getConditionSql() {
		return conditionSql;
	}

	public void setConditionSql(String conditionSql) {
		this.conditionSql = conditionSql;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}    
    

}
